Optimal. Leaf size=42 \[ -\frac {(a B+A b) \log (\cos (c+d x))}{d}+x (a A-b B)+\frac {b B \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.03, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3525, 3475} \[ -\frac {(a B+A b) \log (\cos (c+d x))}{d}+x (a A-b B)+\frac {b B \tan (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3525
Rubi steps
\begin {align*} \int (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=(a A-b B) x+\frac {b B \tan (c+d x)}{d}+(A b+a B) \int \tan (c+d x) \, dx\\ &=(a A-b B) x-\frac {(A b+a B) \log (\cos (c+d x))}{d}+\frac {b B \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 59, normalized size = 1.40 \[ a A x-\frac {a B \log (\cos (c+d x))}{d}-\frac {A b \log (\cos (c+d x))}{d}-\frac {b B \tan ^{-1}(\tan (c+d x))}{d}+\frac {b B \tan (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.66, size = 50, normalized size = 1.19 \[ \frac {2 \, {\left (A a - B b\right )} d x + 2 \, B b \tan \left (d x + c\right ) - {\left (B a + A b\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.33, size = 329, normalized size = 7.83 \[ \frac {2 \, A a d x \tan \left (d x\right ) \tan \relax (c) - 2 \, B b d x \tan \left (d x\right ) \tan \relax (c) - B a \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \relax (c)^{2} - 2 \, \tan \left (d x\right )^{3} \tan \relax (c) + \tan \left (d x\right )^{2} \tan \relax (c)^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \relax (c) + 1\right )}}{\tan \relax (c)^{2} + 1}\right ) \tan \left (d x\right ) \tan \relax (c) - A b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \relax (c)^{2} - 2 \, \tan \left (d x\right )^{3} \tan \relax (c) + \tan \left (d x\right )^{2} \tan \relax (c)^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \relax (c) + 1\right )}}{\tan \relax (c)^{2} + 1}\right ) \tan \left (d x\right ) \tan \relax (c) - 2 \, A a d x + 2 \, B b d x + B a \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \relax (c)^{2} - 2 \, \tan \left (d x\right )^{3} \tan \relax (c) + \tan \left (d x\right )^{2} \tan \relax (c)^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \relax (c) + 1\right )}}{\tan \relax (c)^{2} + 1}\right ) + A b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \relax (c)^{2} - 2 \, \tan \left (d x\right )^{3} \tan \relax (c) + \tan \left (d x\right )^{2} \tan \relax (c)^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \relax (c) + 1\right )}}{\tan \relax (c)^{2} + 1}\right ) - 2 \, B b \tan \left (d x\right ) - 2 \, B b \tan \relax (c)}{2 \, {\left (d \tan \left (d x\right ) \tan \relax (c) - d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 77, normalized size = 1.83 \[ \frac {b B \tan \left (d x +c \right )}{d}+\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) A b}{2 d}+\frac {a \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) B}{2 d}+\frac {a A \arctan \left (\tan \left (d x +c \right )\right )}{d}-\frac {B \arctan \left (\tan \left (d x +c \right )\right ) b}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.91, size = 50, normalized size = 1.19 \[ \frac {2 \, B b \tan \left (d x + c\right ) + 2 \, {\left (A a - B b\right )} {\left (d x + c\right )} + {\left (B a + A b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.32, size = 55, normalized size = 1.31 \[ \frac {B\,b\,\mathrm {tan}\left (c+d\,x\right )+\frac {A\,b\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{2}+\frac {B\,a\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{2}+A\,a\,d\,x-B\,b\,d\,x}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.18, size = 73, normalized size = 1.74 \[ \begin {cases} A a x + \frac {A b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {B a \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - B b x + \frac {B b \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (A + B \tan {\relax (c )}\right ) \left (a + b \tan {\relax (c )}\right ) & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________